//导入工具类
import request from "@/utils/request";

//查询所有行业类型
export const getAllTreatment = (pageNum,pageSize,keyword) =>{
    return request.get(`/treatmenttype/page?pageNum=${pageNum}&pageSize=${pageSize}&keyWord=${keyword}`);
}

//查询总页数
export const getAllPage = (keyword) =>{
    return request.get(`/treatmenttype/count?keyWord=${keyword}`);
}

//删除企业待遇
export const deleTreat = (id) =>{
    let a ={
        id:id
    }
    return request.get("/treatmenttype/del",a);
}

//修改企业待遇
export const changeTreat = (treat) =>{
    let t 
    if(treat.treatmentTypeId == 0){
        t = {
            treatmentTypeName:treat.treatmentTypeName,
            treatmentTypeIcon:treat.treatmentTypeIcon,
            treatmentRefer:treat.treatmentRefer,
            tip: 0
        }
    }else{
        t = {
            treatmentTypeId:treat.treatmentTypeId,
            treatmentTypeName:treat.treatmentTypeName,
            treatmentTypeIcon:treat.treatmentTypeIcon,
            treatmentRefer:treat.treatmentRefer,
        }
    }
    
    return request.post("/treatmenttype",t);
}